<template>
  <div class="sidebar">
      <el-radio-group v-model="isCollapse" style="margin-bottom: 20px; margin-top: 23px;">
        <el-radio-button title="展开列表" :label="false"><i class="el-icon-circle-plus-outline"></i></el-radio-button>
        <el-radio-button title="收缩列表" :label="true"><i class="el-icon-remove-outline"></i></el-radio-button>
      </el-radio-group>
      <el-menu :default-active="$route.path"  class="el-menu-vertical-demo" :collapse="isCollapse">
        <el-menu-item index="1" @click="changeCenter">
          <i class="el-icon-user-solid" ></i>
          <span slot="title">个 人 中 心</span>
        </el-menu-item>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-s-home">  </i>
            <span slot="title">部门管理</span>
          </template>
          <el-menu-item-group>
            <template slot="title">部门</template>
            <el-menu-item index="/department/list" @click="changeDepartment">部门列表</el-menu-item>
            <el-menu-item index="/department/myDepartment" @click="changeMyDepartment">我的部门</el-menu-item>            
          </el-menu-item-group>        
        </el-submenu>
        <el-submenu index="3">
          <template slot="title">
            <i class="el-icon-menu"></i>
            <span slot="title">权限管理</span>
          </template>
          <el-menu-item-group>
            <template slot="title">权限</template>
            <el-menu-item index="/administrator/user" @click="changeUser">用户管理</el-menu-item>
            <el-menu-item index="/administrator/role" @click="changeRole">角色管理</el-menu-item>
            <el-menu-item index="/administrator/menu" @click="changeMenu">菜单管理</el-menu-item>            
          </el-menu-item-group>
        </el-submenu>
        <el-submenu index="4">
          <template slot="title">
            <i class="el-icon-s-management"></i>
            <span slot="title">考勤管理</span>
          </template>
          <el-menu-item-group>
            <template slot="title">考勤</template>
            <el-menu-item index="/attendance/attendanceList" @click="changeAttendanceList">出勤管理</el-menu-item>
            <el-menu-item index="/attendance/leave" @click="changeLeave">请假管理</el-menu-item>          
          </el-menu-item-group>
        </el-submenu>         
        <el-submenu index="5">
          <template slot="title">
            <i class="el-icon-chat-dot-round"></i>
            <span slot="title">消息管理</span>
          </template>
          <el-menu-item-group>
            <template slot="title">消息</template>
            <el-menu-item index="/notice/noticeList" @click="changeNoticeList">消息列表</el-menu-item>
            <el-menu-item index="/notice/sendMessage" @click="changeSendMessage">发送消息</el-menu-item>
            <el-menu-item index="/notice/noticeLog" @click="changeNoticeLog">消息日志</el-menu-item>            
          </el-menu-item-group>
        </el-submenu>        
        <el-submenu index="6">
          <template slot="title">
            <i class="el-icon-setting"></i>
            <span slot="title">日志管理</span>
          </template>          
          <el-menu-item-group>
            <template slot="title">日志</template>
            <el-menu-item index="/log/loginLog" @click="loginLog">登录日志</el-menu-item>
            <el-menu-item index="/log/operationLog" @click="operationLog">操作日志</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
      </el-menu>
  </div>
</template>

<script>
export default {
  name: "sidebar",
  data(){
    return{
      isCollapse:false,
    }
  },
  methods:{
    //个人中心
    changeCenter(){
      this.$router.replace('/AppIndex/center')
    },
    //部门管理
    changeDepartment(){
      this.$router.replace('/department/list')

    },
    changeMyDepartment(){
      this.$router.replace('/department/myDepartment')

    },
    //权限管理
    changeUser(){
      this.$router.replace('/administrator/user')

    },
    changeRole(){
      this.$router.replace('/administrator/role')
    },
    changeMenu(){
      this.$router.replace('/administrator/menu')
    },
    //考勤管理
    changeAttendanceList(){
      this.$router.replace('/attendance/attendanceList')

    },
    changeLeave(){
      this.$router.replace('/attendance/leave')

    },
    //消息管理
    changeNoticeList(){
      this.$router.replace('/notice/noticeList')

    },
    changeSendMessage(){
      this.$router.replace('/notice/sendMessage')
    },
    changeNoticeLog(){
      this.$router.replace('/notice/noticeLog')
    },
    //日志管理
    loginLog(){
      this.$router.replace('/log/loginLog')
    },
    operationLog(){
      this.$router.replace('/log/operationLog')

    },
  }
}
</script>

<style scoped>


</style>
